<template>
  <div class="lm-mdc-container">
    <!--工具栏-->
    <div class="head-container lm-opts-rtght">
      <crudOperation>
        <div slot="right">
          <el-input placeholder="请输入内容" style="width:150px;display:inline-block;" suffix-icon="el-icon-search"></el-input>
          <el-date-picker style="width:150px;display:inline-block;" type="date" placeholder="选择日期" suffix-icon="el-icon-date"></el-date-picker>
        </div>
        <rrOperation slot="optsLeft" :crud="crud"></rrOperation>
      </crudOperation>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" stripe :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="patientName" sortable label="寄送时间"></el-table-column>
        <el-table-column prop="parentProfession" sortable label="快递公司"></el-table-column>
        <el-table-column prop="parentProfession1" sortable label="快递单号"></el-table-column>
        <el-table-column prop="parentProfession2" label="物流状态"></el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination></pagination>
    </div>
  </div>

</template>

<script>
import crudPatient from '@/api/patient';
import CRUD, { presenter, header, crud } from '@crud/crud';
import rrOperation from '@crud/RR.operation';
import crudOperation from '@crud/CRUD.operation';
import pagination from '@crud/Pagination';
import { mapGetters } from 'vuex';

export default {
  name: 'MailDentalCast',
  components: { pagination, crudOperation, rrOperation },
  mixins: [presenter(), header(), crud()],
  dicts: ['gender', 'patient_compliance', 'patient_parent_rel', 'patient_archive'],
  cruds() {
    return CRUD({
      title: 'PatientService',
      url: '/patient/queryPage',
      sort: 'id,desc',
      crudMethod: { ...crudPatient },
      props: { searchToggle: false },
      optShow: { add: false, download: false, reset: false },
      optRightShow: {
        search: false,
        refresh: false
      }
    });
  },
  data() {
    return {
      rules: {
      },
      searchTools: []
    };
  },
  computed: {
    ...mapGetters([
      'autoPath',
      'menusCode',
      'codes'
    ])
  },
  mounted() {
    this.searchTools = this.menusCode[this.codes.DOC_WORK] && this.menusCode[this.codes.DOC_WORK].children;
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true;
    },
    searchButton(item) {
      console.warn(item.code, item.name);
    }
  }
};
</script>

<style lang="scss" scoped>
.lm-mdc-container {
}
</style>
